package com.jiangcheng.demo.mapper;

import com.jiangcheng.demo.entity.Liked;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2021-09-13
 */
public interface LikedMapper extends BaseMapper<Liked> {

    @Select("select count(*) from liked where obj_id = #{objId} and like_type = #{type}")
    Integer count(Integer objId,Integer type);


    @Select("select * from liked where obj_id = #{objId} and  like_type = #{type} and u_id = #{uId}")
    Liked findExists(Integer objId, Integer type, Integer uId);
}
